﻿@using FwProject.Distribution.Dto.Statistics
@model DeliverySituationDto
@{
    ViewBag.Title = "配送情况统计";
}
@section styles{
    <link href="~/Theme/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Theme/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <style type="text/css">
        .input-group[class*=col-] {
            padding: 0 15px;
        }
    </style>
}
<div class="row wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>@ViewBag.Title</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="buttons.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li>
                            <a href="javascript:Print()">打印</a>
                        </li>
                        <li>
                            <a href="javascript:">导出</a>
                        </li>
                    </ul>
                    @*<a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>*@
                </div>
            </div>
            <div class="ibox-content">

                <div id="data_list">
                    <div id="table_print">
                        @if (Model == null)
                        {
                            <h4>暂无数据</h4>
                        }
                        else
                        {
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>统计结果</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td><h2>当天已送餐厅 <span class="text-danger">@Model.Nowadays</span> 家</h2></td>
                                        <td><button class="btn btn-info btn-lg" onclick="top.window.openTab(10001,'当天已送餐厅详情','@Url.Action("DeliverySituationDetails",new { ramge=DeliveryTimeRange.Nowadays })');"><i class="fa fa-edit"></i>详情</button></td>
                                    </tr>
                                    <tr>
                                        <td><h2>1天未配送餐厅 <span class="text-danger">@Model.OneDay</span> 家</h2></td>
                                        <td><button class="btn btn-info btn-lg" onclick="top.window.openTab(10002,'1天未配送餐厅详情','@Url.Action("DeliverySituationDetails",new { ramge=DeliveryTimeRange.OneDay })');"><i class="fa fa-edit"></i>详情</button></td>
                                    </tr>
                                    <tr>
                                        <td><h2>2天未配送餐厅 <span class="text-danger">@Model.TwoDays</span> 家</h2></td>
                                        <td><button class="btn btn-info btn-lg" onclick="top.window.openTab(10003,'2天未配送餐厅详情','@Url.Action("DeliverySituationDetails",new { ramge=DeliveryTimeRange.TwoDays })');"><i class="fa fa-edit"></i>详情</button></td>
                                    </tr>
                                    <tr>
                                        <td><h2>3-7天未配送餐厅 <span class="text-danger">@Model.ThreeToSevenDays</span> 家</h2></td>
                                        <td><button class="btn btn-info btn-lg" onclick="top.window.openTab(10004,'3-7天未配送餐厅','@Url.Action("DeliverySituationDetails",new { ramge=DeliveryTimeRange.ThreeToSevenDays })');"><i class="fa fa-edit"></i>详情</button></td>
                                    </tr>
                                    <tr>
                                        <td><h2>超过7天未送餐厅 <span class="text-danger">@Model.OverSevenDays</span> 家</h2></td>
                                        <td><button class="btn btn-info btn-lg" onclick="top.window.openTab(10005,'超过7天未送餐厅','@Url.Action("DeliverySituationDetails",new { ramge=DeliveryTimeRange.OverSevenDays })');"><i class="fa fa-edit"></i>详情</button></td>
                                    </tr>
                                </tbody>
                            </table>
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@*<div id="modal_ajax" class="modal inmodal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    </div>*@
@section scripts{
    <script src="~/Theme/js/content.min.js?v=1.0.0"></script>
    <script src="~/Theme/js/plugins/iCheck/icheck.min.js"></script>
    <script src="~/Theme/js/plugins/datapicker/bootstrap-datepicker.js"></script>

    <script src="~/js/PrintUtil.js"></script>
    <script type="text/javascript">

        function Print() {
            printGirdObj({
                containerId: 'table_print',//包含表格容器のID
                title: '@ViewBag.Title',
                showRowNum: false,  //表格中rownumbers: true时为true
                showOrder: false,//是否显示序号，rownumbers: true时有效，默认false
                printInit: { //打印初始化设置参数
                    portrait: false //true纵向,false横向
                }
            });
        }


        //layer.msg("test",{time:2000});
        $(document).ready(function () {
            $('#modal_ajax').on('show.bs.modal', function (e) {
                $(this).addClass('loading');
                var $button = $(e.relatedTarget);
                var url = $button.data('url');
                if (!!url) {
                    url = url + ((url.indexOf("?") > -1) ? "&r=" : "?r=") + Math.random();
                    $(this).load(url, function () {
                        $.validator.unobtrusive.parse(this); //$("#form_model_create").validate();
                        $("input[name='Member.Birthday']").datepicker({ todayBtn: "linked", keyboardNavigation: !1, forceParse: !1, calendarWeeks: !0, autoclose: !0 });
                        $(".i-checks").iCheck({ checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green", });
                        $(this).removeClass('loading');
                    });
                }
            });
            $('#modal_ajax').on('hidden.bs.modal', function (e) {
                $(this).empty();
            });

            $('#modal_del,#modal_password_reset').on('show.bs.modal', function (e) {
                var $button = $(e.relatedTarget);
                var url = $button.data('url');
                if (!!url)
                    url = url + ((url.indexOf("?") > -1) ? "&r=" : "?r=") + Math.random();
                $(this).find("form").attr("action", url);
            });
            $('#modal_del,#modal_password_reset').on('hidden.bs.modal', function (e) {
                $(this).find("form").attr("action", "");
            });
        });

    </script>
}
